/**
 * Author:yuiop
 * Date:2022/8/30 15:29
 */
package com.devops.admin.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.devops.admin.model.DOSMetrics;
import com.devops.admin.model.TableResult;
import com.devops.admin.vo.DOSMetricsVo;
import com.devops.admin.vo.DOSPageVo;
import io.prometheus.client.Collector;

import java.io.IOException;
import java.util.List;

public interface DOSMetricsService extends IService<DOSMetrics> {

    /**
     * 获取数据库中所有metrics指标并处理
     * @return
     */
    List<Collector.MetricFamilySamples> getAllMetrics();

    /**
     * 根据指标名称获取单个指标并处理
     * @param metricsName
     * @return
     */
    String getMetricsByName(String metricsName) throws IOException;

    /**
     * 增加新指标前的测试步骤
     * @param dosMetricsVo
     * @return
     */
    String testMetrics(DOSMetricsVo dosMetricsVo) throws IOException;


    /**
     * @Author heyabo
     * @Description 增加新指标
     * @Date 09:44 2022/8/31
     * @Param [dosMetrics]
     * @return boolean
     **/
    boolean saveMetrics(DOSMetricsVo dosMetrics);

    /**
     * @Author heyabo
     * @Description 分页查询指标
     * @Date 10:17 2022/8/31
     * @Param [dosMetricsVo]
     * @return com.devops.admin.model.TableResult<com.devops.admin.model.DOSMetrics>
     **/
    TableResult<DOSMetrics> getPage(DOSMetricsVo dosMetricsVo, DOSPageVo pageVo);

    /**
     * @Author heyabo
     * @Description 更新指标
     * @Date 13:46 2022/8/31
     * @Param [dosMetricsVo]
     * @return boolean
     **/
    boolean updateMetrics(DOSMetricsVo dosMetricsVo);

    /**
     * @Author heyabo
     * @Description 删除指标信息
     * @Date 13:53 2022/8/31
     * @Param [metricsId]
     * @return boolean
     **/
    boolean removeMetricsById(Integer metricsId);
}
